/*
type int
parse 5 '2+3='
parse 5 2 + 3 '='
parse 35  '(' '' 2+3 ' )' '*' '(3 +' '4)' =
*/
Expression <- _ s:Sum $ Equals -> s
Sum <- p:Product $ Plus $ s:Sum -> { p + s }
     / Product
Product <- t:Term $ Star $ p:Product -> { t * p }
         / Term
Term <- Decimal / lBrace $ s:Sum $ rBrace -> s
# lexical elements
Decimal <- [0-9]+ _ -> { atoi(ref_str()) }
Plus :: void <- "+" _
Star <- "*" _
Equals <- "=" _
lBrace <- "(" _
rBrace <- ")" _
_ <- [ \t\n]*
